package com.pks.datacenter.entity.api;

import lombok.Data;
import lombok.EqualsAndHashCode;

import com.pks.util.coder.database.DBField;
import com.pks.util.coder.database.DBQuery;
import com.pks.util.coder.database.DBTable;
import com.pks.web.mybatis.entity.BasicEntity;

@Data
@EqualsAndHashCode(callSuper = true)
@DBTable(tags = "接口日志" , index_normal = {"apiUserId,apiId"})
public class ApiLog extends BasicEntity {
	
	private static final long serialVersionUID = -1675586389839456136L;

	@DBField(comment = "接口账号ID")
	@DBQuery
	private Long apiUserId;

	@DBField(comment = "接口账号名称")
	@DBQuery
	private String apiUserAccount;
	
	@DBField(comment = "接口ID")
	@DBQuery
	private Long apiId;
	
	@DBField(comment = "接口方法名")
	@DBQuery
	private String apiMethodName;
	
	@DBField(comment = "接口参数" , length = 2000)
	private String params;
	
	@DBField(comment = "请求IP")
	@DBQuery
	private String requestIp;
	
	@DBField(comment = "请求地址")
	private String requestUrl;

	@DBField(comment = "结果状态")
	private Integer resultState;
	
	@DBField(comment = "结果描述" , length = 2000)
	private String resultContent;
	
	@DBField(comment = "请求耗时")
	private Long time;
	
	public ApiLog(){
		super();
	}

	public ApiLog(Long apiUserId, String apiUserAccount, Long apiId,
			String apiMethodName, String params, String requestIp,
			String requestUrl, Integer resultState, String resultContent,
			Long time) {
		super();
		this.apiUserId = apiUserId;
		this.apiUserAccount = apiUserAccount;
		this.apiId = apiId;
		this.apiMethodName = apiMethodName;
		this.params = params;
		this.requestIp = requestIp;
		this.requestUrl = requestUrl;
		this.resultState = resultState;
		this.resultContent = resultContent;
		this.time = time;
	}
	
	
	
	
	

}
